﻿<%@ Page MasterPageFile="Site1.Master" Language="C#" AutoEventWireup="true" CodeBehind="ProcessRequest.aspx.cs"
    Inherits="EqRepair.Web.ProcessRequest" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphMainContent" runat="server">
    <asp:DropDownList ID="DropDownListOrg" runat="server" DataSourceID="LinqDataSource3"
        DataTextField="Name" DataValueField="Id" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
    </asp:DropDownList>
    <asp:LinqDataSource ID="LinqDataSource3" runat="server" ContextTypeName="EqRepair.Code.Data.DataClasses2DataContext"
        OnSelecting="LinqDataSource3_Selecting" TableName="Organizations">
    </asp:LinqDataSource>
    <asp:Button ID="ButtonSelOrg" runat="server" OnClick="ButtonSelOrg_Click" Text="Выбрать организацию" />
    <asp:Button ID="ButtonSelAl" runat="server" OnClick="ButtonSelAl_Click" Text="Для всех" />
    <asp:GridView ID="GridView1" runat="server" AllowSorting="True" AutoGenerateColumns="False"
        CellPadding="4" ForeColor="#333333" GridLines="None" AutoGenerateSelectButton="True"
        OnSelectedIndexChanged="GridView1_SelectedIndexChanged">
        <RowStyle BackColor="#EFF3FB" />
        <Columns>
            <asp:BoundField DataField="Id" HeaderText="Код" />
            <asp:BoundField DataField="FullName" HeaderText="Создатель" />
            <asp:TemplateField HeaderText="Статус">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Status") %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:DropDownList Enabled="false" ID="TextBox2" runat="server" Text='<%# Bind("Status") %>'>
                        <asp:ListItem Value="1">Новая</asp:ListItem>
                        <asp:ListItem Value="2">В работе</asp:ListItem>
                        <asp:ListItem Value="3">Выполнена</asp:ListItem>
                        <asp:ListItem Value="4">Закрыта </asp:ListItem>
                    </asp:DropDownList>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="CreatedDateTime" HeaderText="Дата создания" />
            <asp:BoundField DataField="Organize" HeaderText="Организация" />
            <asp:BoundField DataField="equipment" HeaderText="Оборудование" />
            <asp:BoundField DataField="RepairCost" HeaderText="Стоимость ремонта" />
            <asp:BoundField DataField="RepairTime" HeaderText="Время ремонта (чел./час)" />
            <asp:BoundField DataField="Descr" HeaderText="Описание заявки" />
        </Columns>
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <EditRowStyle BackColor="#2461BF" />
        <AlternatingRowStyle BackColor="White" />
    </asp:GridView>
    <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="EqRepair.Code.Data.DataClasses2DataContext"
        EnableDelete="True" EnableInsert="True" EnableUpdate="True" TableName="RequestForRepairs">
    </asp:LinqDataSource>
    <asp:LinqDataSource ID="LinqDataSource2" runat="server">
    </asp:LinqDataSource>
    <asp:Panel ID="PanelReqMod" runat="server">
        <asp:Button ID="ButtonClose" runat="server" Text="Закрыть" OnClick="ButtonClose_Click" />
        <asp:Panel ID="Panel1" runat="server" BorderStyle="Solid">
            <asp:Label ID="dsd" runat="server" Text="Выбор исполнителя наряда"></asp:Label>
            <asp:DropDownList ID="DropDownListEmpl" runat="server" 
                onselectedindexchanged="DropDownListEmpl_SelectedIndexChanged">
            </asp:DropDownList>
            <br />
            <asp:TextBox ID="TextBoxDes" runat="server" Height="55px" TextMode="MultiLine" 
                Width="335px"></asp:TextBox>
            <br />
            <asp:Button ID="ButtonCrOr" runat="server" OnClick="ButtonCrOr_Click" Text="Создать наряд" />
        </asp:Panel>
        <asp:Label ID="LabelMes" runat="server"></asp:Label>
        <asp:Panel ID="PanelOrd" runat="server">
            <asp:GridView ID="GridViewOrd" runat="server" AutoGenerateColumns="False"   CellPadding="4"
                ForeColor="#333333" GridLines="None" AllowSorting="True" OnSelectedIndexChanged="GridViewOrd_SelectedIndexChanged">
                <RowStyle BackColor="#EFF3FB" />
                <Columns>
                    <asp:CommandField ShowSelectButton="True" />
                    <asp:BoundField HeaderText="Код" DataField="Id" />
                    <asp:BoundField DataField="RequestId" HeaderText="Код заявки" />
                    <asp:BoundField HeaderText="Исполнитель" DataField="FullName" />
                    <asp:TemplateField HeaderText="Статус">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Status") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:DropDownList Enabled="false" ID="TextBox23" runat="server" Text='<%# Bind("Status") %>'>
                                <asp:ListItem Value="1">Новый</asp:ListItem>
                                <asp:ListItem Value="2">В работе</asp:ListItem>
                                <asp:ListItem Value="3">Выполнен</asp:ListItem>
                            </asp:DropDownList>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="Descr" HeaderText="Описание наряда" />
                </Columns>
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <EditRowStyle BackColor="#2461BF" />
                <AlternatingRowStyle BackColor="White" />
            </asp:GridView>
            <asp:Button ID="ButtonOrdFin" runat="server" Text="Работа выполнена" OnPreRender="ButtonOrdFin_PreRender"
                OnClick="ButtonOrdFin_Click" />
            <asp:Label ID="Info" runat="server"></asp:Label>
        </asp:Panel>
        <br />
    </asp:Panel>
</asp:Content>
